﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="authors.aspx.vb" Inherits="GLOBALDATABASE.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        #Button1
        {
            height: 24px;
            width: 128px;
        }
        #Button2
        {
            height: 26px;
            width: 92px;
        }
        #Button3
        {
            height: 27px;
            width: 119px;
            margin-left: 41px;
        }
        #Text1
        {
            margin-left: 45px;
            width: 191px;
            margin-bottom: 0px;
        }
        #Text2
        {
            margin-left: 26px;
            width: 194px;
        }
        .style1
        {
            height: 29px;
        }
        .style2
        {
            height: 30px;
        }
        #Text3
        {
            height: 65px;
            width: 179px;
        }
    </style>
    <script language="javascript" type="text/javascript">
// <![CDATA[

       
        Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CmdEnviar.Click 
        InstPubs.SQLDataSource.Insert() 
        GridView2.DataBind() 
        End Sub
        }

function Button2_onclick() {
Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CmdBorrar.Click TxtCodGenero.Text = "" TxtDescripcion.Text = "" TxtGenero.Text = "" TxtCodGenero.Focus() End Sub
}

// ]]>
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="au_id" DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField DataField="au_id" HeaderText="au_id" ReadOnly="True" 
                SortExpression="au_id" />
            <asp:BoundField DataField="au_lname" HeaderText="au_lname" 
                SortExpression="au_lname" />
            <asp:BoundField DataField="au_fname" HeaderText="au_fname" 
                SortExpression="au_fname" />
            <asp:BoundField DataField="phone" HeaderText="phone" SortExpression="phone" />
            <asp:BoundField DataField="address" HeaderText="address" 
                SortExpression="address" />
            <asp:BoundField DataField="city" HeaderText="city" SortExpression="city" />
            <asp:BoundField DataField="state" HeaderText="state" SortExpression="state" />
            <asp:BoundField DataField="zip" HeaderText="zip" SortExpression="zip" />
            <asp:CheckBoxField DataField="contract" HeaderText="contract" 
                SortExpression="contract" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="Data Source=MILE-PC;Initial Catalog=pubs;Integrated Security=True" 
        DeleteCommand="DELETE FROM [authors] WHERE [au_id] = @au_id" 
        InsertCommand="INSERT INTO [authors] ([au_id], [au_lname], [au_fname], [phone], [address], [city], [state], [zip], [contract]) VALUES (@au_id, @au_lname, @au_fname, @phone, @address, @city, @state, @zip, @contract)" 
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [authors]" 
        UpdateCommand="UPDATE [authors] SET [au_lname] = @au_lname, [au_fname] = @au_fname, [phone] = @phone, [address] = @address, [city] = @city, [state] = @state, [zip] = @zip, [contract] = @contract WHERE [au_id] = @au_id">
        <DeleteParameters>
            <asp:Parameter Name="au_id" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:ControlParameter ControlID="TextBox1" Name="au_id" PropertyName="Text" 
                Type="String" />
            <asp:Parameter Name="au_fname" Type="String" />
            <asp:Parameter Name="phone" Type="String" />
            <asp:Parameter Name="address" Type="String" />
            <asp:Parameter Name="city" Type="String" />
            <asp:Parameter Name="state" Type="String" />
            <asp:Parameter Name="zip" Type="String" />
            <asp:Parameter Name="contract" Type="Boolean" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="au_lname" Type="String" />
            <asp:Parameter Name="au_fname" Type="String" />
            <asp:Parameter Name="phone" Type="String" />
            <asp:Parameter Name="address" Type="String" />
            <asp:Parameter Name="city" Type="String" />
            <asp:Parameter Name="state" Type="String" />
            <asp:Parameter Name="zip" Type="String" />
            <asp:Parameter Name="contract" Type="Boolean" />
            <asp:Parameter Name="au_id" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <table id="table1" style="width:100%;">
        <tr>
            <td>
                <asp:Label ID="au_id" runat="server" Text="au_id"></asp:Label>
                <asp:TextBox ID="TextBox1" runat="server" style="margin-left: 23px" 
                    Width="137px"></asp:TextBox>
            </td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style1">
                <asp:Label ID="Label1" runat="server" Text="authors"></asp:Label>
&nbsp;<input id="Text2" type="text" /></td>
            <td class="style1">
                </td>
            <td class="style1">
                </td>
        </tr>
        <tr>
            <td class="style1">
                <asp:Label ID="Label2" runat="server" Text="DESCRIPCCION"></asp:Label>
&nbsp;<input id="Text3" type="text" /></td>
            <td class="style1">
                </td>
            <td class="style1">
                </td>
        </tr>
        <tr>
            <td class="style2">
                <input id="Button1" type="button" value="ENVIAR" 
                    onclick="return Button1_onclick()" /><input id="Button2" 
                    type="button" value="BORRAR" onclick="return Button2_onclick()" /></td>
            <td class="style2">
                </td>
            <td class="style2">
                </td>
        </tr>
    </table>
</asp:Content>
